<template>
  <div>
    <el-row class="tac">
      <el-col :span="24">
        <h5>自定义颜色</h5>
        <!-- default-active: 默认激活的模块 -->
        <!-- @open: 展开菜单时的回调函数 -->
        <!-- @close: 关闭菜单时的回调函数 -->
        <!-- active-text-color: 菜单被激活时的字体颜色 -->
        <!-- unique-opened: 是否只保持一个子菜单的展开 -->
        <!-- router: 是否开启路由模式，以index作为path跳转 -->
        <el-menu
          :default-active="$route.path"
          class="el-menu-vertical-demo"
          background-color="#262a32"
          text-color="rgb(204, 204, 204)"
          active-text-color="#ffd04b"
          :unique-opened="true"
          router
        >
          <el-menu-item index="/">
            <i class="el-icon-setting"></i>
            <span slot="title">首页</span>
          </el-menu-item>
          <el-submenu
            :index="String(index+1)"
            v-for="(item, index) in menuList"
            :key="index"
          >
            <template slot="title">
              <i :class="item.icon"></i>
              <span>{{item.title}}</span>
            </template>
            <el-menu-item-group>
              <el-menu-item
                v-for="(subItem, subIndex) in item.children"
                :key="subIndex"
                :index="subItem.url">{{subItem.title}}</el-menu-item>
            </el-menu-item-group>
          </el-submenu>
          <!-- <el-submenu index="2">
            <template slot="title">
              <i class="el-icon-location"></i>
              <span>系统设置</span>
            </template>
            <el-menu-item-group>
              <el-menu-item index="/menu">菜单管理</el-menu-item>
              <el-menu-item index="/role">角色管理</el-menu-item>
              <el-menu-item index="/admin">管理员管理</el-menu-item>
            </el-menu-item-group>
          </el-submenu>
          <el-submenu index="3">
            <template slot="title">
              <i class="el-icon-location"></i>
              <span>商城管理</span>
            </template>
            <el-menu-item-group>
              <el-menu-item index="1-1">菜单管理</el-menu-item>
              <el-menu-item index="1-2">角色管理</el-menu-item>
              <el-menu-item index="1-2">管理员管理</el-menu-item>
            </el-menu-item-group>
          </el-submenu> -->
        </el-menu>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'
export default {
  data() {
    return {};
  },
  computed: {
    ...mapGetters([
      'menuList'
    ])
  },
  methods: {},
};
</script>

<style>
</style>